package com.ktgj.customer.domain.Insurance.dftModel;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

import java.io.Serializable;


public class EnumHelp implements Serializable {
    public enum ModeType {
        zan_yes(1, "国内飞行标签"),

        zan_score(1, "航旅评分模型"),

        fcyn_yes(1, "航空行为模型"),

        fmd_score(1, "消费能力模型"),

        fcee_score(1, "舱位偏好模型"),

        dtkd_score(1, "时度分析模型");

        ModeType(Integer value, String name) {
            this.value = value;
            this.name = name;
        }

        public static Integer getValue(String name) {
            for (ModeType s : ModeType.values()) {
                if (s.getName().equals(name)) {
                    return s.getValue();
                }
            }
            return -1;
        }

        public static String getName(int value) {
            for (ModeType s : ModeType.values()) {
                if (s.getValue() == value) return s.getName();
            }
            return "";
        }

        @JsonValue
        private Integer value;
        private String name;

        public Integer getValue() {
            return value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public String getName() {
            return name;
        }

        @JsonCreator
        public void setName(String name) {
            this.name = name;
        }

    }



    public enum InsuranceType {

        ZA20(1, "众安航意险20元-电子发票"),
        ZA30(2, "众安航意险30元-电子发票"),
        ZA40(3, "众安航意险40元-电子发票"),
        ZA50(4, "众安航意险50元-电子发票"),
        ZAX20(5, "众安航意险20元-行程单"),
        ZAX30(6, "众安航意险30元-行程单"),//
        ZAX40(7, "众安航意险40元-行程单"),
        ZAX50(8, "众安航意险50元-行程单"),


        ZAQ20(9, "众安七天航意险20元-电子发票"),
        ZAQ30(10, "众安七天航意险30元-电子发票"),
        ZAQ40(11, "众安七天航意险40元-电子发票"),
        ZAQ50(12, "众安七天航意险50元-电子发票"),

        ZAXQ20(13, "众安七天航意险20元-行程单"),
        ZAXQ30(14, "众安七天航意险30元-行程单"),
        ZAXQ40(15, "众安七天航意险40元-行程单"),
        ZAXQ50(16, "众安七天航意险50元-行程单");



        InsuranceType(Integer value, String name) {
            this.value = value;
            this.name = name;
        }

        public static Integer getValue(String name) {
            for (InsuranceType s : InsuranceType.values()) {
                if (s.getName().equals(name)) {
                    return s.getValue();
                }
            }
            return 1;
        }

        public static String getName(Integer value) {
            for (InsuranceType s : InsuranceType.values()) {
                if (s.getValue() == value) return s.getName();
            }
            return "";
        }

        @JsonValue
        private Integer value;
        private String name;

        public Integer getValue() {
            return value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }


        @JsonCreator
        public static InsuranceType getEnumByValue(Integer value) {
            for (InsuranceType bt : values()) {
                if (bt.value.equals( value)) {
                    return bt;
                }
            }
            return null;
        }
    }




    /**
     * 年龄类型
     */
    public enum AgeType {
        ADU(0, "成人"),
        CHD(1, "儿童"),
        INF(2, "婴儿");

        AgeType(Integer value, String name) {
            this.value = value;
            this.name = name;
        }

        public static Integer getValue(String name) {
            for (AgeType s : AgeType.values()) {
                if (s.getName().equals(name)) {
                    return s.getValue();
                }
            }
            return -1;
        }

        public static String getName(Integer value) {
            for (AgeType s : AgeType.values()) {
                if (s.getValue().equals(value)) return s.getName();
            }
            return "";
        }

        @JsonValue
        private Integer value;
        private String name;

        public Integer getValue() {
            return value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @JsonCreator
        public static AgeType getEnumByValue(Integer value) {
            for (AgeType bt : values()) {
                if (bt.getValue().equals(value)) {
                    return bt;
                }
            }
            return null;
        }
    }
}